package cn.ekuma.epos.datalogic.define;

import com.openbravo.data.loader.table.I_TableSentenceBuilder;
import e.odbo.data.dao.DataLogic;
import cn.ekuma.epos.datalogic.I_DataLogicPDA;
import cn.ekuma.epos.datalogic.define.dao.ProductExtDAO;
import cn.ekuma.epos.datalogic.define.dao.ProductImageDAO;
import cn.ekuma.epos.datalogic.define.dao.pda.ProductByteImageDAO;

import com.openbravo.data.basic.BasicException;
import com.openbravo.data.loader.I_Session;

public class DataLogicPDA extends DataLogic implements I_DataLogicPDA {

	public DataLogicPDA(I_Session s, I_TableSentenceBuilder tableSentenceBuilder) {
		super(s,tableSentenceBuilder);
		productImageDAO=new ProductImageDAO(s);
		addDaoToMap(productImageDAO);
		 
		productByteImageDAO=new ProductByteImageDAO(s,productImageDAO);
		addDaoToMap(productByteImageDAO);
		 
		productExtDAO=new ProductExtDAO(s);
		addDaoToMap(productExtDAO);
	}

	ProductByteImageDAO productByteImageDAO;
	ProductImageDAO productImageDAO;
	ProductExtDAO productExtDAO;

	@Override
	public Class transParentClass(Class in) {
		return DateLogicUtils.transParentClass(in);
	}
	

	@Override
	public void saveMainProductImage(String id,byte[] m_ImageDatas) throws BasicException {
		productExtDAO.saveProductImage(id,m_ImageDatas);
	}
	
}
